package cn.iocoder.yudao.module.biz.dal.mysql.htPlanDetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.controller.admin.htPlan.vo.HtPlanPageReqVO;
import cn.iocoder.yudao.module.biz.controller.admin.htPlan.vo.HtPlanRiskVO;
import cn.iocoder.yudao.module.biz.dal.dataobject.htPlanDetail.HtPlanDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.htPlanDetail.vo.*;

/**
 * 隐患排查计划详情 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface HtPlanDetailMapper extends BaseMapperX<HtPlanDetailDO> {

    default PageResult<HtPlanDetailDO> selectPage(HtPlanDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HtPlanDetailDO>()
                .eqIfPresent(HtPlanDetailDO::getPlanId, reqVO.getPlanId())
                .eqIfPresent(HtPlanDetailDO::getRiskId, reqVO.getRiskId())
//                .eqIfPresent(HtPlanDetailDO::getRiskState, reqVO.getRiskState())
                .orderByDesc(HtPlanDetailDO::getId));
    }

    default List<HtPlanDetailDO> selectList(HtPlanDetailExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<HtPlanDetailDO>()
                .eqIfPresent(HtPlanDetailDO::getPlanId, reqVO.getPlanId())
                .eqIfPresent(HtPlanDetailDO::getRiskId, reqVO.getRiskId())
//                .eqIfPresent(HtPlanDetailDO::getRiskState, reqVO.getRiskState())
                .orderByDesc(HtPlanDetailDO::getId));
    }

    List<HtPlanRiskVO> queryByPlan(HtPlanDetailPageReqVO pageVO);

    Integer queryByPlanCount(HtPlanDetailPageReqVO pageVO);
}
